package org.eclipse.wtp.puzzled;

import static org.junit.Assert.*;
import org.eclipse.wtp.puzzled.Msg;
import org.eclipse.wtp.puzzled.MsgList;


import org.junit.Test;

public class TestMsgBox {

	@Test
	public void test() {
		int type = 1;
		Msg m = new Msg("no", type);
		Msg m2= new Msg("yes", 2);
		if(!m.getMsg().equals("no"))
			fail("Msg failed to write");
		type= m.getType();
		if(m.getType() != 1)
			fail("Type was inserted wrong");
		if(!m.findClass().equals("success"))
			fail("Class was wrong");
		if(!m2.findClass().equals("error"))
			fail("Class was wrong");
			
		
		// For MSGLIST.java
		MsgList msg = new MsgList();
		msg.addMsg("Yes", 1);
		if(msg.numMsgs()!=1)
			fail("The number of added msgs were wrong");
		msg.addMsg("No",0);
		if(msg.numMsgs()!=2)
			fail("The number of added msgs were wrong");
		msg.fetchAll();
	}

}
